﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Convertor.Plugin.InputAndOutput
{
    public class MemoryContent : IEquatable<MemoryContent>, IEquatable<object>, IEquatable<string>
    {
        public string Name { get; set; }
        public object Content { get; set; }
        public override string ToString()
        {
            return Name.ToString();
        }

        #region IEquatable<MemoryContent> 成员

        public override bool Equals(object obj)
        {
            return this.Name == obj.ToString();
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        #endregion

        #region IEquatable<MemoryContent> 成员

        public bool Equals(MemoryContent other)
        {
            return this.Name == other.Name;
        }

        #endregion

        #region IEquatable<string> 成员

        public bool Equals(string other)
        {
            return this.Name == other;
        }

        #endregion
    }
}
